<!-- Functions -->
<% Function FormatStepDescription(ByVal objStep) : If objStep.Status = "Failed" Then : FormatStepDescription = "<font color=""red"">" & objStep.StepDescription & "</font>" : Else : FormatStepDescription = objStep.StepDescription : End If : End Function %>
<!-- /Functions -->

<html>
	<head>
		<title><% Return DetailedReportTitle %></title>
		<style type="text/css">
			.content {width: 1024px; margin-left: auto; margin-right: auto; text-align: left;}
		
			body {font-family: tahoma; font-size: 14px; color: #444444; text-align: center;}

			td {padding: 5px; font-family: tahoma; font-size: 14px; color: #444444;}
			
			.pass {color: #6A953B;}
			.fail {color: #F26E1B;}
			.description {font-size: 10px;}
			
			.odd td {background-color: #EEEEEE;}
			.even td {background-color: #FFFFFF;}
			.header td {background-color: #666666; color: #EEEEEE;}
			
			.a4 td {border-top: 2px solid #999999;}
			
			a {margin-bottom: 3px; text-decoration: none; border-bottom: 1px dashed #444444; color: #444444; display: inline-block}
			a:hover {border-bottom: 1px dashed #0066CC; margin-bottom: 3px; text-decoration: none; color: #0066CC; display: inline-block}
			
			.info td {font-size: 11px; padding: 3px; width: 400px;}
		</style>
	</head>

	<body>
		<div class="content">
			<a href="General Report.html" style="font-size: 11px">Back to General Report</a>
			<br /><br />
			<font color="#BB2200" style="font-size: 24px;"><% Return TestScript.GetTestScriptInfo("Name") %></font><br />
			<% If TestScript.Iterate Then %>
				<font color="#BB2200" style="font-size: 16px;"><% Return TestScriptIteration.IterationName %></font><br />
			<% End If %>
			<div style="background-color: #F7DE9D;><font color="#BB2200" style="font-size: 14px;"><% Return TestScript.GetTestScriptInfo("Description") %></font></div>
			<br />
			<div style="background-color: #F8F4E6; width: 100%; border: 2px solid #cccccc">
				<table class="info" cellspacing="2" cellpadding="0">
					<tr>
						<td align="right"><font style="color: #A0A0A0;">TestScript Name:</font></td>
						<td><% Return TestScript.GetTestScriptInfo("Name") %></td>
					</tr>
					<% If TestScript.Iterate Then %>
						<tr>
							<td align="right"><font style="color: #A0A0A0;">Iteration Name:</font></td>
							<td><% Return TestScriptIteration.IterationName %></td>
						</tr>
					<% End If %>
					<tr>
						<td align="right"><font style="color: #A0A0A0;">Created By:</font></td>
						<td><% Return TestScript.GetTestScriptInfo("CreatedBy") %></td>
					</tr>
					<tr>
						<td align="right"><font style="color: #A0A0A0;">Status:</font></td>
						<td><% Return TestScriptIteration.Status %></td>
					</tr>
					<tr>
						<td align="right"><font style="color: #A0A0A0;">Percentage:</font></td>
						<td><% Return TestScriptIteration.Percentage %></td>
					</tr>
					<% If TestScriptIteration.Status = "Failed" Then %>
						<tr>
							<td align="right"><font style="color: #A0A0A0;">Error Description:</font></td>
							<td><% Return TestScriptIteration.ErrorDescription %></td>
						</tr>
					<% End If %>
				</table>
			</div>
			<br />
			<% Set ActionList = TestScriptIteration.ActionList %>
			
			<% blnPreCondition = False %>
			<% blnPostCondition = False %>
			
			<% For Each strKey In ActionList.Keys %>
				<% If ActionList(strKey).ActionType = "Pre-Condition" Then blnPreCondition = True %>
				<% If ActionList(strKey).ActionType = "Post-Condition" Then blnPostCondition = True %>
			<% Next %>
			
			<table style="border: 0px">
				<tr>
					<td>
						Pre-conditions:<br />
						<% If blnPreCondition Then %>
							<ol>
								<% arrStepId = ActionList.Keys %>
								
								<% For i=0 To UBound(arrStepId) %>
									<% If ActionList(arrStepId(i)).ActionType = "Pre-Condition" Then %>
										<li style="font-size: 12px;"><% Return FormatStepDescription(ActionList(arrStepId(i))) %></li>
										<% ActionList.Remove(arrStepId(i)) %>
									<% End If %>
								<% Next %>
							</ol>
						<% Else %>
							&nbsp;&nbsp;&nbsp;&nbsp; None
						<% End If %>
					</td>
				</tr>
			</table>
			<br />
			<table cellspacing="0" width="100%">
				<tr class="header">
					<td width="5%">Step</td>
					<td width="35%">Inputs/Actions</td>
					<td width="35%">Expected Results</td>
					<td width="25%">Actual Results</td>
				</tr>
				<% arrStepId = ActionList.Keys %>
				<% intId = 1 %>
				
				<% For i=0 To UBound(arrStepId) %>
					<% If ActionList(arrStepId(i)).ActionType = "Post-Condition" Then %>
						<% Exit For %>
					<% ElseIf ActionList(arrStepId(i)).ActionType = "Scenario" Then %>
						<tr class="odd">
							<td colspan="4">
								<% Return ActionList(arrStepId(i)).StepDescription %>
							</td>
						</tr>
						<% ActionList.Remove(arrStepId(i)) %>
					<% ElseIf ActionList(arrStepId(i)).ActionType <> "Iteration Name" Then %>
						<% blnExpectedResult = False : strInputAction = "" : strExpectedResults = "" : strActualResults = "" %>
						
						<% For j=i To UBound(arrStepId) %>
							<% If ActionList(arrStepId(j)).ActionType = "Input" Or ActionList(arrStepId(j)).ActionType = "Action" Then %>
								<% If blnExpectedResult Then %>
									<% i = j-1 : Exit For %>
								<% End If %>
								<% strInputAction = strInputAction & FormatStepDescription(ActionList(arrStepId(j))) & "<br />" %>
								<% If ActionList(arrStepId(j)).Status = "Failed" Then strActualResults = ActionList(arrStepId(j)).Comment %>
								<% ActionList.Remove(arrStepId(j)) %>
							<% ElseIf ActionList(arrStepId(j)).ActionType = "Expected Result" Then %>
								<% blnExpectedResult = True %>
								<% strExpectedResults = strExpectedResults & FormatStepDescription(ActionList(arrStepId(j))) & "<br />" %>
								<% If ActionList(arrStepId(j)).Status = "Failed" Then strActualResults = ActionList(arrStepId(j)).Comment %>
								<% ActionList.Remove(arrStepId(j)) %>
							<% Else %>
								<% i = j-1 %>
								<% Exit For %>
							<% End If %>
						<% Next %>
						<tr>
							<td  style="font-size: 12px;" align="right"><% Return intId %>.</td>
							<td style="font-size: 12px;"><% Return strInputAction %></td>
							<td style="font-size: 12px;"><% Return strExpectedResults %></td>
							<td style="font-size: 12px;"><% Return strActualResults %></td>
						</tr>
						<% If j = UBound(arrStepId)+1 Then Exit For %>
						<% intId = intId + 1 %>
					<% End If %>
				<% Next %>
			</table>
			<br />
			<table style="border: 0px">
				<tr>
					<td>
						Post-conditions:
						<% If blnPostCondition Then %>
							<ol>
								<% arrStepId = ActionList.Keys %>
								
								<% For i=0 To UBound(arrStepId) %>
									<% If ActionList(arrStepId(i)).ActionType = "Post-Condition" Then %>
										<li style="font-size: 12px;"><% Return FormatStepDescription(ActionList(arrStepId(i))) %></li>
										<% ActionList.Remove(arrStepId(i)) %>
									<% End If %>
								<% Next %>
							</ol>
						<% Else %>
							&nbsp;&nbsp;&nbsp;&nbsp; None
						<% End If %>
					</td>
				</tr>
			</table>
			<br />
			<span style="font-size:16px; display: block; margin-top: 20px; margin-bottom: 10px; color: #3F8FFF;">Test Results</span>
			<% Set objTestResult = TestResult.Results %>
			<table cellspacing="0" width="100%">
				<tr class="header">
					<td>Parameter Name</td>
					<td>Value</td>
				</tr>
				<% If objTestResult.Count > 0 Then %>
					<% For Each strKey In objTestResult.Keys %>
					<tr>
						<td width="50%"><% Return strKey %></td>
						<td width="50%"><% Return objTestResult(strKey) %></td>
					</tr>
					<% Next %>
				<% Else %>
					<tr>
						<td colspan="2">No Test Results</td>
					</tr>
				<% End If %>
			</table>
			<span style="font-size:16px; display: block; margin-top: 20px; margin-bottom: 10px; color: #3F8FFF;">Screen Shots</span>
			<table cellspacing="0" width="100%">
				<tr class="header">
					<td>Screen Shots</td>
				</tr>
				<tr>
					<td>
						<span style="display: inline-block; margin: 5px;">
							<span style="display: inline-block; width: 100px; height: 100px; background-color: #E5E5E5"></span><br />
							<font style="font-size: 13px; color: #444444;"><sup>Screen shot 1..</sup></font>
						</span>
						<span style="display: inline-block; margin: 5px;">
							<span style="display: inline-block; width: 100px; height: 100px; background-color: #E5E5E5"></span><br />
							<font style="font-size: 13px; color: #444444;"><sup>Screen shot 2..</sup></font>
						</span>
					</td>
				</tr>
			</table>
		</div>
	</body>
</html>